<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page import="java.util.*,
						org.apache.commons.logging.Log, 
						org.apache.commons.logging.LogFactory,
						com.ophelisis.common.util.*,
						com.ophelisis.common.consts.*,
						com.ophelisis.common.consts.ConstCode.MenuGNB,
						com.ophelisis.actions.system.*"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="page" uri="/tld/xdp-page.tld"%>

<!-- List Start -->
<%@ include file="/WEB-INF/jsp/common/resultMessageLocal.jsp"%>
<form id="searchForm" name="searchForm" method="post">
</form>
<div id="formtitle">
	<div id="formlist3l" class="flo_l">
		<form id="groupForm" name="groupForm" method="post">
			<input type="hidden" id="isNew" name="isNew" value="Y" />
			<input type="hidden" id="menuGroupId" name="menuGroupId" value="" />
			<table class="liststyle1">
				<colgroup>
					<col width="" />
				</colgroup>
				<tr>
					<th scope="col">그룹</th>
				</tr>
			</table>
			<ul id="rGroup">
				<li class="ulPlusMenu"><a href="#" class="clickable" onclick="javascript:pmModule.setAddGroup();">그룹 추가</a></li>
				 <c:choose>
					<c:when test="${menuGroupList != '' && !empty menuGroupList}">
						<c:forEach var="mgList" items="${menuGroupList}" varStatus="status">
							<li class="ulMenu <c:if test="${mgList.menuGroupId == _prevUpCode}">selected</c:if>" id="group_${mgList.menuGroupId}">
								<c:if test="${mgList.useYn == 'N'}">
									<div class="flo_l"><img src="images/icon/icon_02.gif" style="padding-top:2px;" />&nbsp;</div>
								</c:if>
								<div class="flo_l"><a href="#" class="clickable" onclick="javascript:pmModule.setModifyGroup('${mgList.menuGroupId}','${mgList.menuGroupNm}','${mgList.menuGroupAlias}','${mgList.menuGroupDesc}','${mgList.menuGroupLink}','${mgList.useYn}');">${mgList.menuGroupNm}</a></div>
								<div class="flo_r">
									<img src="images/btn/btn_delete.gif" class="clickable" onclick="javascript:pmModule.setDeleteGroup('${mgList.menuGroupId}');" />
									<img src="images/btn/btn_select02.gif" class="clickable" onclick="javascript:pmModule.selectGroup('${mgList.menuGroupId}');" />
								</div>
							</li>
							<input type="hidden" id="use_${mgList.menuGroupId}" name="use_${mgList.menuGroupId}" value="${mgList.useYn}" />
						</c:forEach>
					</c:when>
					<c:otherwise>
						<li class="ulMenu"></li>
					</c:otherwise>
				</c:choose>
			</ul>
			<ul id="addGroupDiv" class="bgWhite nodisplay">
				<li class="ulFormMenu">그룹 이름 : <input type="text" id="menuGroupNm" name="menuGroupNm" class="in3 intex_l width_50c" value="" /></li>
				<li class="ulFormMenu">그룹 별칭 : <input type="text" id="menuGroupAlias" name="menuGroupAlias" class="in3 intex_l width_50c" value="" /></li>
				<li class="ulFormMenu">그룹 설명 : <input type="text" id="menuGroupDesc" name="menuGroupDesc" class="in3 intex_l width_50c" value="" /></li>
				<li class="ulFormMenu">그룹 링크 : <input type="text" id="menuGroupLink" name="menuGroupLink" class="in3 intex_l width_50c" value="" /></li>
				<li class="ulFormMenu">사용 여부 : <input type="radio" id="useYn1" name="useYn" value="Y" checked="checked" /> 사용 <input type="radio" id="useYn2" name="useYn" value="N" /> 미사용</li>
				<li class="ulFormMenu tex_center">
					<img src="images/btn/btn_cancel.gif" class="clickable" onclick="javascript:pmModule.cancelGroup();" />&nbsp;
					<img src="images/btn/btn_save.gif" class="clickable" onclick="javascript:pmModule.saveGroup();" />
				</li>
			</ul>
		</form>
	</div>
	<div id="formlist3r" class="flo_l">
		<form id="menuForm" name="menuForm" method="post">
			<input type="hidden" id="isNew" name="isNew" value="Y" />
			<input type="hidden" id="menuGroupId" name="menuGroupId" value="" />
			<input type="hidden" id="menuId" name="menuId" value="" />
			<input type="hidden" id="menuValue" name="menuValue" value="" />
			<table class="liststyle1">
				<colgroup>
					<col width="" />
				</colgroup>
				<tr>
					<th scope="col">메뉴</th>
				</tr>
			</table>
			<ul id="rMenu" class="nodisplay">
				<li class="ulPlusMenu"><a href="#" class="clickable" onclick="javascript:pmModule.setAddMenu();">메뉴 추가</a></li>
				 <c:choose>
					<c:when test="${menuList != '' && !empty menuList}">
						<c:forEach var="mList" items="${menuList}" varStatus="status">
							<li class="ulMenu group_${mList.menuGroupId} nodisplay <c:if test="${mList.menuId == _prevCode}">selected</c:if>" id="menu_${mList.menuId}">
								<c:if test="${mList.useYn == 'N'}">
									<div class="flo_l"><img src="images/icon/icon_02.gif" style="padding-top:2px;" />&nbsp;</div>
								</c:if>
								<div class="flo_l">
									<a href="#" class="clickable" onclick="javascript:pmModule.setModifyMenu('${mList.menuId}','${mList.menuNm}','${mList.menuType}','${mList.menuDesc}','${mList.useYn}');">
									<span 
										<c:if test="${mList.codeUseYn == 'N' || mList.codeGroupUseYn == 'N'}">class="tex_selected" title="[ 메뉴 유형 오류 ] 사용하지 않거나 삭제된 메뉴 유형으로 지정되어 있습니다. 메뉴 유형을 변경하여 주십시오."</c:if>
									>${mList.menuNm}</span>
									</a>
								</div>
								<div class="flo_r">
									<img src="images/btn/btn_delete.gif" class="clickable" onclick="javascript:pmModule.setDeleteMenu('${mList.menuId}');" />
								</div>
							</li>
						</c:forEach>
					</c:when>
					<c:otherwise>
						<li class="ulMenu"></li>
					</c:otherwise>
				</c:choose>
			</ul>
			<ul id="addMenuDiv" class="bgWhite nodisplay">
				<li class="ulFormMenu">메뉴 이름 : <input type="text" id="menuNm" name="menuNm" class="in3 intex_l width_50c" value="" /></li>
				<li class="ulFormMenu">메뉴 유형 : 
					<select id="menuType" name="menuType" onchange="javascript:pmModule.selectMenuType(this);">
						<option value="">== 유형 선택 ==</option>
						<c:choose>
							<c:when test="${codeList != '' && !empty codeList}">
								<c:forEach var="cList" items="${codeList}" varStatus="status">
									<option value="${cList.codeValue}" action="${cList.codeLink}">${cList.codeNm}</option>
								</c:forEach>
							</c:when>
						</c:choose>
					</select>
				</li>
				<li class="ulFormMenu">메뉴 설명 : <input type="text" id="menuDesc" name="menuDesc" class="in3 intex_l width_50c" value="" /></li>
				<li class="ulFormMenu">사용 여부 : <input type="radio" id="useYn1" name="useYn" value="Y" checked="checked" /> 사용 <input type="radio" id="useYn2" name="useYn" value="N" /> 미사용</li>
				<li class="ulFormMenu tex_center">
					<img src="images/btn/btn_cancel.gif" class="clickable" onclick="javascript:pmModule.cancelMenu();" />&nbsp;
					<img src="images/btn/btn_save.gif" class="clickable" onclick="javascript:pmModule.saveMenu();" />
				</li>
			</ul>
		</form>
	</div>
</div>
<!-- List End -->
